namespace JQuery.WebKit
{
    using System.ComponentModel;
    using System.Security.Permissions;
    using System.Web;
    using System.Web.UI;

    [TypeConverter(typeof(ExpandableObjectConverter)), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public sealed class DeleteDialogSettings : IStateManager
    {
        private bool _isTracking;
        private StateBag _viewState = new StateBag();

        void IStateManager.LoadViewState(object state)
        {
            if (state != null)
            {
                ((IStateManager) this.ViewState).LoadViewState(state);
            }
        }

        object IStateManager.SaveViewState()
        {
            return ((IStateManager) this.ViewState).SaveViewState();
        }

        void IStateManager.TrackViewState()
        {
            this._isTracking = true;
            ((IStateManager) this.ViewState).TrackViewState();
        }

        public override string ToString()
        {
            return string.Empty;
        }

        [NotifyParentProperty(true), Category("Appearance"), Description("The text label of the 'Cancel' button in edit dialog. Defaults to current localization settings, setting it will override localization default."), DefaultValue("")]
        public string CancelText
        {
            get
            {
                object obj2 = this.ViewState["CancelText"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["CancelText"] = value;
            }
        }

        [NotifyParentProperty(true), Category("Appearance"), Description("The caption of the dialog. Defaults to localization settings."), DefaultValue("")]
        public string Caption
        {
            get
            {
                object obj2 = this.ViewState["DeleteCaption"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["DeleteCaption"] = value;
            }
        }

        [Category("Appearance"), Description("The message that will be displayed as a confirmation question in the delete dialog."), DefaultValue(""), NotifyParentProperty(true)]
        public string DeleteMessage
        {
            get
            {
                object obj2 = this.ViewState["DeleteMessage"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["DeleteMessage"] = value;
            }
        }

        [Category("Appearance"), Description("Determines if the dialog window should be draggable. Default is true."), NotifyParentProperty(true), DefaultValue(true)]
        public bool Draggable
        {
            get
            {
                object obj2 = this.ViewState["Draggable"];
                return ((obj2 == null) || ((bool) obj2));
            }
            set
            {
                this.ViewState["Draggable"] = value;
            }
        }

        [DefaultValue(300), Description("The height of the edit dialog. Default is 300. Accepts only integer numbers."), NotifyParentProperty(true), Category("Appearance")]
        public int Height
        {
            get
            {
                object obj2 = this.ViewState["Height"];
                if (obj2 == null)
                {
                    return 300;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["Height"] = value;
            }
        }

        [DefaultValue(0), NotifyParentProperty(true), Category("Appearance"), Description("The left (x) offset of the dialog window, relative to the grid upper left corner. Accepts negative values. ")]
        public int LeftOffset
        {
            get
            {
                object obj2 = this.ViewState["LeftOffset"];
                if (obj2 == null)
                {
                    return 0;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["LeftOffset"] = value;
            }
        }

        [Description("The text message the will be displayed while server on deleting. Defaults to current localization settings, setting it will override localization default."), Category("Appearance"), NotifyParentProperty(true), DefaultValue("")]
        public string LoadingMessageText
        {
            get
            {
                object obj2 = this.ViewState["LoadingMessageText"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["LoadingMessageText"] = value;
            }
        }

        [NotifyParentProperty(true), Category("Appearance"), Description("Determines if the dialog should be modal or not. Default is false."), DefaultValue(false)]
        public bool Modal
        {
            get
            {
                object obj2 = this.ViewState["Modal"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["Modal"] = value;
            }
        }

        [Description("Specifies if the grid should be reloaded after deleting. Default is true."), NotifyParentProperty(true), DefaultValue(true), Category("Appearance")]
        public bool ReloadAfterSubmit
        {
            get
            {
                object obj2 = this.ViewState["ReloadAfterSubmit"];
                return ((obj2 == null) || ((bool) obj2));
            }
            set
            {
                this.ViewState["ReloadAfterSubmit"] = value;
            }
        }

        [NotifyParentProperty(true), DefaultValue(true), Description("Determines if the dialog window should be resizable. Default is true."), Category("Appearance")]
        public bool Resizable
        {
            get
            {
                object obj2 = this.ViewState["Resizable"];
                return ((obj2 == null) || ((bool) obj2));
            }
            set
            {
                this.ViewState["Resizable"] = value;
            }
        }

        [DefaultValue(""), NotifyParentProperty(true), Category("Appearance"), Description("The text label of the 'Submit' button in delete dialog. Defaults to current localization settings, setting it will override localization default.")]
        public string SubmitText
        {
            get
            {
                object obj2 = this.ViewState["SubmitText"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["SubmitText"] = value;
            }
        }

        bool IStateManager.IsTrackingViewState
        {
            get
            {
                return this._isTracking;
            }
        }

        [NotifyParentProperty(true), Description("The top (y) offset of the dialog window, relative to the grid upper left corner. Accepts negative values. "), DefaultValue(0), Category("Appearance")]
        public int TopOffset
        {
            get
            {
                object obj2 = this.ViewState["TopOffset"];
                if (obj2 == null)
                {
                    return 0;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["TopOffset"] = value;
            }
        }

        private StateBag ViewState
        {
            get
            {
                return this._viewState;
            }
        }

        [Category("Appearance"), NotifyParentProperty(true), DefaultValue(300), Description("The width of the edit dialog. Default is 300. Accepts only integer numbers.")]
        public int Width
        {
            get
            {
                object obj2 = this.ViewState["Width"];
                if (obj2 == null)
                {
                    return 300;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["Width"] = value;
            }
        }
    }
}

